package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.ThisUserMapper;
import com.ruoyi.user.domain.ThisUser;
import com.ruoyi.user.service.IThisUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户Service业务层处理
 * 
 * @author yg
 * @date 2023-11-23
 */
@Service
public class ThisUserServiceImpl implements IThisUserService 
{
    @Autowired
    private ThisUserMapper thisUserMapper;

    /**
     * 查询客户
     * 
     * @param uId 客户主键
     * @return 客户
     */
    @Override
    public ThisUser selectThisUserByUId(Long uId)
    {
        return thisUserMapper.selectThisUserByUId(uId);
    }

    /**
     * 查询客户列表
     * 
     * @param thisUser 客户
     * @return 客户
     */
    @Override
    public List<ThisUser> selectThisUserList(ThisUser thisUser)
    {
        return thisUserMapper.selectThisUserList(thisUser);
    }

    /**
     * 新增客户
     * 
     * @param thisUser 客户
     * @return 结果
     */
    @Override
    public int insertThisUser(ThisUser thisUser)
    {
        return thisUserMapper.insertThisUser(thisUser);
    }

    /**
     * 修改客户
     * 
     * @param thisUser 客户
     * @return 结果
     */
    @Override
    public int updateThisUser(ThisUser thisUser)
    {
        thisUser.setUpdateTime(DateUtils.getNowDate());
        return thisUserMapper.updateThisUser(thisUser);
    }

    /**
     * 批量删除客户
     * 
     * @param uIds 需要删除的客户主键
     * @return 结果
     */
    @Override
    public int deleteThisUserByUIds(String uIds)
    {
        return thisUserMapper.deleteThisUserByUIds(Convert.toStrArray(uIds));
    }

    /**
     * 删除客户信息
     * 
     * @param uId 客户主键
     * @return 结果
     */
    @Override
    public int deleteThisUserByUId(Long uId)
    {
        return thisUserMapper.deleteThisUserByUId(uId);
    }
}
